using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;

// TODO: replace this with the type you want to read.
using TRead = Ssb.ContentTypes.Menu_Content;

namespace Ssb.ContentTypeReaders
{
    /// <summary>
    /// This class will be instantiated by the XNA Framework Content
    /// Pipeline to read the specified data type from binary .xnb format.
    /// 
    /// Unlike the other Content Pipeline support classes, this should
    /// be a part of your main game project, and not the Content Pipeline
    /// Extension Library project.
    /// </summary>
    public class MenuReader : ContentTypeReader<TRead>
    {
        protected override TRead Read(ContentReader input, TRead existingInstance)
        {
            TRead r = new Ssb.ContentTypes.Menu_Content();

            r.cursor = input.ReadString();

            int count = input.ReadInt32();

            List<string> ls = new List<string>();

            for (int i = 0; i < count; i++)
            {
                ls.Add(input.ReadString());
            }

            r.Items = ls;
            r.Parent = input.ReadString();

            r.bg = input.ReadString();

            return r;
        }
    }
}
